package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
@TableName("t_product")
public class ProductBean {
    //商品id
    @TableId(value = "pk_productId",type = IdType.AUTO)
    private  Integer id;
    //商品名称
    @TableField("p_name")
    private  String name;
    //商品单价
    @TableField("p_price")
    private  Integer price;
    //商品图片
    @TableField("p_img")
    private  String img;
    //商品的产地
    @TableField("p_madeIn")
    private  String madeIn;
    //商品的生产日期
    @TableField("p_date")
    private LocalDate date;
    //商品数量
    @TableField(exist = false)
    private  int sum;

    @Override
    public String toString() {
        return "ProductBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", img='" + img + '\'' +
                ", madeIn='" + madeIn + '\'' +
                ", date=" + date +
                ", sum=" + sum +
                "}\n";
    }

    public ProductBean() {
    }

    public ProductBean(String name, Integer price, String img, String madeIn, LocalDate date) {
        this.name = name;
        this.price = price;
        this.img = img;
        this.madeIn = madeIn;
        this.date = date;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getMadeIn() {
        return madeIn;
    }

    public void setMadeIn(String madeIn) {
        this.madeIn = madeIn;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public int getSum() {
        return sum;
    }

    public void setSum(int sum) {
        this.sum = sum;
    }
}
